<template>
    <div class="loading-bar"></div>
</template>

<script>
export default {
    name: 'LoadingBar'
}
</script>

<style>
    .loading-bar{
        position: fixed;
        left: 0;
        top: 0;
        z-index: 2147483647;
        width: 100%;
        height: 2px;
    }

    .loading-bar:before{
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        height: 100%;
        background-color: #b91f1f;
        -webkit-animation: loading 1.5s infinite linear;
        animation: loading 1.5s infinite linear;
    }

    @-webkit-keyframes loading {
        0% {
            left: 0;
            width: 0%;
        }

        50% {
            left: 0;
            width: 100%;
        }

        99% {
            left: 100%;
            width: 0%;
        }
    }

    @keyframes loading {
        0% {
            left: 0;
            width: 0%;
        }

        50% {
            left: 0;
            width: 100%;
        }

        99% {
            left: 100%;
            width: 0%;
        }
    }
</style>